import type React from "react";

type Icon = "home" | "smile";

const ICON_TO_EMOJI: Record<Icon, string> = {
  home: "🏠",
  smile: "😂",
};

type IconProps = {
  icon: Icon;
  style?: React.CSSProperties | undefined;
  className?: string | undefined;
};

/**
 * 带有常见属性的组件示例
 */
export default function Icon({ icon, style, className }: IconProps) {
  return (
    <span style={style} className={className}>
      {ICON_TO_EMOJI[icon]}
    </span>
  );
}
